package service.menu;

import bean.LessMoney;
import client.LoginClient;
import client.MnueClient;
import dao.search.LessMonySearchDao;
import service.InTimeSearchService;
import service.search.*;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;
import java.util.Scanner;

public class PersonMenuService {
    public void messageSys() throws SQLException, ParseException {

        Scanner sc = new Scanner(System.in);

        LoginClient lc = new LoginClient();

        System.out.println("---------------------欢迎登录信息查询系统---------------------");
        System.out.println("请根据提示信息进行菜单选择：");
        System.out.println("1.住宿查询\n2.个人信息查询\n3.房间查询\n4.班级查询\n5.欠费查询\n6.钥匙领取查询\n7.记录查询\n输入10返回菜单");
        int choice = sc.nextInt();
        switch (choice) {
            case 1:
                StaySearchService sss = new StaySearchService();
                sss.show();
                break;
            case 2:
                PersonSearchService pss = new PersonSearchService();
                pss.show();
                break;
            case 3:
                RoomSearchService rss = new RoomSearchService();
                rss.show();
                break;
            case 4:
                ClassSearchService css = new ClassSearchService();
                css.show();
                break;
            case 5:
                LessMonySearchDao lmsd = new LessMonySearchDao();
                List<LessMoney> inChecks = lmsd.findAll();
                System.out.println(inChecks.toString());
                System.out.println("输入0返回上一层菜单");
                int a1 = sc.nextInt();
                if (0 == a1) {
                    PersonMenuService pms = new PersonMenuService();
                    pms.messageSys();
                }
                break;
            case 6:
                KeySearchService kss = new KeySearchService();
                kss.show();
                break;
            case 7:
                InTimeSearchService itss = new InTimeSearchService();
                itss.recordQuery();
                break;
            case 10:
                lc.Login();
                break;
            case 11:
                ManagerMenuService mms = new ManagerMenuService();
                mms.managerMenu();
                break;
            case 12:
                SuperManagerMenuService smms = new SuperManagerMenuService();
                smms.superManagerSys();
                break;
            default:
                lc.Login();
                break;


        }
    }
}
